/*************************************************************************
	> File Name: 2.test.c
	> Author: WangYiFei
	> Mail: 824537320@qq.com
	> Created Time: Thu 07 Jan 2021 09:33:38 PM CST
 ************************************************************************/

#include "head.h"

int main() {
    FILE *fp = NULL;
    if ((fp = fopen("./a.txt", "r")) == NULL) {
        perror("fopen");
        exit(1);
    }
    while (1) {
        char buff[512] = {0};
        size_t nread = fread(buff, 1, sizeof(buff), fp);
        printf("%s", buff);
        if (nread <= 0) {
            break;
        }
    }
    fclose(fp);
    return 0;
}
